package com.lcx.view;

import com.lcx.constact.Path;
import com.lcx.core.HandleCore;
import com.lcx.core.StartingTodo;
import com.lcx.test.Main;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;

import java.net.URL;
import java.util.ResourceBundle;

public class RootController implements Initializable {

    @FXML
    private WebView webView;

    private WebEngine webEngine;

    private static RootController wr;

    private static HandleCore handleCore=null;

    @Override
        public void initialize(URL location, ResourceBundle resources) {
            wr=this;
            webEngine = webView.getEngine();

            try {
                StartingTodo.copyResource();
                StartingTodo.setPath();
            } catch (Exception e) {
            }
            handleCore = new HandleCore(webEngine);
            handleCore.setStage(Main.stage);
            handleCore.init();
            webEngine.load(Path.indexPage);
    }
}
